package com.heima.scan.kafkalistener;

import com.heima.scan.service.WmNewsService;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class NewsListener {
    @Autowired
    private WmNewsService wmNewsService;

    @KafkaListener(topics = "news.check.topic",groupId = "groupid1")
    public  void   NEwsListener(ConsumerRecord<String,String> record){
        String id = record.value();
        wmNewsService.check(Long.valueOf(id));
    }
}
